// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`maybe.js 1`] = `
// @flow

// unwrapping nested maybes should work
(('foo': ?(?string)): ?string); // ok
((123: ?(?number)): ?string); // error (only num ~> string)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow

// unwrapping nested maybes should work
(("foo": ??string): ?string); // ok
((123: ??number): ?string); // error (only num ~> string)

`;

exports[`nullable.js 1`] = `
function foo():string { return null; }

function bar():?string { return null; }

function qux(x:string) { }

function corge(x:number) { }

var x = bar(); // x: ?string
if (x != null) qux(x); // x: ?string | null
if (x != null) corge(x); // x: ?string | null

function grault() { x = null; }
if (x != null) {
  grault(); qux(x);
}

var array_of_nullable: Array<?number> = [null, 3];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function foo(): string {
  return null;
}

function bar(): ?string {
  return null;
}

function qux(x: string) {}

function corge(x: number) {}

var x = bar(); // x: ?string
if (x != null) qux(x); // x: ?string | null
if (x != null) corge(x); // x: ?string | null

function grault() {
  x = null;
}
if (x != null) {
  grault();
  qux(x);
}

var array_of_nullable: Array<?number> = [null, 3];

`;

exports[`simple_nullable.js 1`] = `
function foo(x:?string) {}
function bar(x:?number) {}
foo('hmm');
bar('hmm');

function fn(data: ?{}) {}
fn({some: 'literal'});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function foo(x: ?string) {}
function bar(x: ?number) {}
foo("hmm");
bar("hmm");

function fn(data: ?{}) {}
fn({ some: "literal" });

`;
